package blt.app_core.api.car;

import java.util.Map;

import blt.app_core.api.base.bean.OAuth;
import blt.app_core.api.base.bean.State;
import blt.app_core.api.car.bean.Car;
import blt.app_core.api.car.bean.CarListVo;
import blt.app_core.utils.UriProdiver;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created by xgp on 2017/6/20.
 */

public interface CarService {

    @POST(UriProdiver.GET_CAR_LIST)
    @FormUrlEncoded
    Call<OAuth<Car>> getCarList(@Field("pageNum") int page, @Field("pageSize") int pageSize);

    @POST(UriProdiver.GET_CAR_DETAIL_INFO)
    @FormUrlEncoded
    Call<State<Car>> getCarDetailInfo(@Field("carId") String carId);

    @POST(UriProdiver.GET_DELETE_CAR)
    @FormUrlEncoded
    Call<OAuth> deleteCar(@Field("carId") int carId);

//    @POST(UriProdiver.UPDATE_CAR)
//    Call<OAuth> updateCar(@FieldMap Map<String, String> params);

    @POST(UriProdiver.UPDATE_CAR)
    @FormUrlEncoded
    Call<OAuth<Car>> updateCar(@Field("carId") String carId, @Field("carPlateNumber") String carPlateNumber,
                               @Field("carModel") String carModel, @Field("carType") int carType,
                               @Field("carSeat") int carSeat, @Field("carPicFront") String carPicFront,
                               @Field("carPicLicense") String carPicLicense);

    @POST(UriProdiver.SET_DEFAULT_CAR)
    @FormUrlEncoded
    Call<State> setDefaultCar(@Field("carId") int carId);
}
